#ifndef LAYERSYSTEM_H
#define LAYERSYSTEM_H
#include "StompedReality/Core.h"
#include "StompedReality/Core/Memory/DataBuffer.h"
#include "StompedReality/Core/MessageSystem/ProcessMessage.h"
#include "StompedReality/Math/Vector2.h"
namespace StompedReality
{
namespace Graphics
{
/*!
 * \author	Stefan Kazalski
 *
 * \brief	Layer system.
 *
 *    Stores 8 layers.
 */
class DLL_EXPORT LayerSystem : protected StompedReality::Core::DataBuffer,
  public StompedReality::Core::MessageHandler
{
 protected:

  //! \brief	Translation position setter.
  void SetTranslation ( int layer, const StompedReality::Math::Vector2 transform );

  //! \brief	Translation speed setter.
  void SetTranslationSpeed ( int layer, const StompedReality::Math::Vector2 speed );
  void TranslateLayer ( int layer, const StompedReality::Math::Vector2 translation );

 public:

  LayerSystem( );
  virtual ~LayerSystem( );

  //! \brief	Translation position getter.
  const StompedReality::Math::Vector2 GetTranslation ( int layer );

  //! \brief	Translation speed getter.
  const StompedReality::Math::Vector2 GetTranslationSpeed ( int layer );

  //! \brief	Processes a message.
  //! \param	msg The message.
  bool ProcessMessage ( StompedReality::Core::Message* msg );

  //! \brief	Reads data.
  //!			Reads data from the json value. No changes if parsing fails.
  //! \param	root	The json value.
  //! \return	Success parsing.
  virtual bool ParseJSON ( Json::Value& root );

  //! \brief	Writes data.
  //!			Writes data to the json value. No changes if parsing fails.
  //! \param	root	The json value.
  //! \return	Success parsing.
  virtual bool WriteJSON ( Json::Value& root );
};

}
}
#endif // LAYERSYSTEM_H
